<template>
    <img :src="imgUrl" ref="imgUrl" alt="" style="max-width: 100%">
</template>

<script>
    export default {
        data(){
            return {
                imgUrl:'',
            }
        },
        methods:{
            jietu(){
                var opts = {
                    allowTaint:true,//允许加载跨域的图片
                    scale:2, // 添加的scale 参数
                    logging: false, //日志开关，发布的时候记得改成false
                    x:190,
                    y:61,
                    width:1094,
                    height:3000,
                    scrollY:255,
                }
                var  that = this;
                this.$canvas(document.body,opts).then(function(canvas) {
                    that.imgUrl = canvas.toDataURL('image/png', 1);
                });
            },
        }
    }
</script>

<style scoped>

</style>